import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Index from '../views/index/index.vue'
import Course from '../views/course/course.vue'
import News from '../views/news/news.vue'
import Book from '../views/book/book.vue'

import Person from '../views/person/person.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/index',
    children: [
      { path: '/index', name: 'Index', component: Index },
      { path: '/course', name: 'Course', component: Course },
      { path: '/news', name: 'News', component: News },
      { path: '/book', name: 'Book', component: Book },
      { path: '/person', name: 'Person', component: Person },
    ]
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },{
    path:'/login',
    name:'Login',
    component:()=> import('@/views/login/login.vue')
  },
  {
    path:'/signin',
    name:'Signin',
    component:()=>import('@/views/person/signin')
  },
  {
    path:'/teacher',
    name:'Teacher',
    component:()=>import('@/views/course/teacher')
  }

]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
